<div style="margin: 20px">
    <form class="layui-form" action="">
        <div>
            <button type="button" class="layui-btn run layui-btn-sm" id="ok">确定</button>
            <button type="button" class="layui-btn run layui-btn-sm" id="close">关闭</button>
        </div>
    <table class="layui-table">
        <tr>
            <td>审批意见:</td>
            <td><textarea  id="taskOpinion" name="taskOpinion"  class="layui-textarea"></textarea></td>
        </tr>
        <tr>
            <td>常用语:</td>
            <td></td>
        </tr>
        <tr>
            <td>附件:</td>
            <td></td>
        </tr>
    </table>
    </form>



</div>
<script>

    layui.use(['table','setter','element','util','layer'], function () {
        var setter = layui.setter
            , $ = layui.$
            , layer = layui.layer
        var taskId = "${taskId!}";
        var procDefId = "${procDefId}"
        var operatorType = "${operatorType}";

        //返回
        $("#close").click(function () {
            var index=parent.layer.getFrameIndex(window.name);
            parent.layer.close(index);
        });

        $("#ok").click(function () {
            var taskOpinion = $("#taskOpinion").val();
            $.ajax({
                url:serverPath.workflowPath + setter.workflowLinkPath+"task/complete",
                dataType: 'json',
                type: "POST",
                data:{taskId: taskId,procDefId:procDefId,taskOpinion:taskOpinion,operatorType: operatorType},
                success:function (result) {
                    layer.open({
                        title: '提示信息'
                        ,content: result.msg
                        ,yes: function(index, layero){
                            //do something
                            parent.parent.window.location.reload();
                        }
                    });

                },
                error: function(result){
                    layer.open({
                        title: '提示信息'
                        ,content: result.msg
                        ,yes: function(index, layero){
                            //do something
                            layer.close(index);
                            window.parent.layer.close(index);
                        }
                    });
                }
            });
        });
    })
</script>
<style>
    .layui-input{
        width: 90%;
    }
</style>